/* GUI CONVERTED from rprsrp.p (converter v1.75) Sat Aug 12 23:11:49 2000 */
/* rprsrp.p - RESOURCE REPORT                                           */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                  */
/* All rights reserved worldwide.  This is an unpublished work.         */
/* web convert rprsrp.p (converter v1.00) Fri Oct 10 13:57:19 1997 */
/* web tag in rprsrp.p (converter v1.00) Mon Oct 06 14:17:45 1997 */
/*F0PN*/ /*K1DB*/ /*                                                    */
/*V8:ConvertMode=FullGUIReport                                 */
/* REVISION: 1.0      LAST MODIFIED: 05/12/86   BY: PML */
/* REVISION: 1.0      LAST MODIFIED: 07/10/87   BY: EMB *A76* */
/* REVISION: 4.0      LAST MODIFIED: 02/24/88   BY: WUG *A175**/
/* REVISION: 8.6      LAST MODIFIED: 12/11/97   BY: bvm *K1DB**/
/* REVISION: 9.1      LAST MODIFIED: 03/24/00   BY: *N08T* Annasaheb Rahane */
/* REVISION: 9.1      LAST MODIFIED: 08/12/00   BY: *N0KP* myb              */

/*K1DB*/ /* DISPLAY TITLE */

/*GUI global preprocessor directive settings */
&GLOBAL-DEFINE PP_PGM_RP TRUE
&GLOBAL-DEFINE PP_ENV_GUI TRUE


/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

/*K1DB*/ {mfdtitle.i "b+ "}

define variable rsc like rs_rsc.
define variable rsc1 like rs_rsc.
define variable site like rs_site.
define variable site1 like rs_site.
define variable start like tr_date.
define variable rsdend like rsd_end.

/*K1DB* /* DISPLAY TITLE */
 * {mfdtitle.i "b+ "} */

site = global_site.
site1 = global_site.


/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
   
 RECT-FRAME       AT ROW 1.4 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1   COLUMN 3 NO-LABEL
 SKIP(.1)  /*GUI*/
rsc            colon 15
   rsc1           label {t001.i} colon 49 skip
   site           colon 15
   site1          label {t001.i} colon 49 skip
   start          colon 15
   rsdend         label {t001.i} colon 49 skip
 SKIP(.4)  /*GUI*/
with frame a side-labels width 80 attr-space NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-a-title AS CHARACTER.
 F-a-title = &IF (DEFINED(SELECTION_CRITERIA) = 0)
  &THEN " Selection Criteria "
  &ELSE {&SELECTION_CRITERIA}
  &ENDIF .
 RECT-FRAME-LABEL:SCREEN-VALUE in frame a = F-a-title.
 RECT-FRAME-LABEL:WIDTH-PIXELS in frame a =
  FONT-TABLE:GET-TEXT-WIDTH-PIXELS(
  RECT-FRAME-LABEL:SCREEN-VALUE in frame a + " ", RECT-FRAME-LABEL:FONT).
 RECT-FRAME:HEIGHT-PIXELS in frame a =
  FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME a = FRAME a:WIDTH-CHARS - .5. /*GUI*/

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



/* SET EXTERNAL LABELS */
setFrameLabels(frame a:handle).

/*K1DB*/ {wbrp01.i}


/*GUI*/ {mfguirpa.i true  "printer" 132 }

/*GUI repeat : */
/*GUI*/ procedure p-enable-ui:


   if site1 = hi_char then site1 = "".
   if rsc1 = hi_char then rsc1 = "".

/*K1DB*/ if c-application-mode <> 'web' then
   
run p-action-fields (input "display").
run p-action-fields (input "enable").
end procedure. /* p-enable-ui, replacement of Data-Entry GUI*/

/*GUI*/ procedure p-report-quote:


/*K1DB*/ {wbrp06.i &command = update &fields = "  rsc rsc1 site site1 start
          rsdend" &frm = "a"}

/*K1DB*/ if (c-application-mode <> 'web') or
/*K1DB*/ (c-application-mode = 'web' and
/*K1DB*/ (c-web-request begins 'data')) then do:

   bcdparm = "".
   {mfquoter.i rsc    }
   {mfquoter.i rsc1   }
   {mfquoter.i site   }
   {mfquoter.i site1  }
   {mfquoter.i start  }
   {mfquoter.i rsdend }

   if site1 = "" then site1 = hi_char.
   if rsc1 = "" then rsc1 = hi_char.

/*K1DB*/ end.

   /* SELECT PRINTER */
   
/*GUI*/ end procedure. /* p-report-quote */
/*GUI - Field Trigger Section */

/*GUI MFSELxxx removed*/
/*GUI*/ procedure p-report:
/*GUI*/   {gpprtrpa.i  "printer" 132}
/*GUI*/   mainloop: do on error undo, return error on endkey undo, return error:




   {mfphead.i}

   for each rs_mstr where rs_rsc >= rsc and rs_rsc <= rsc1
   and rs_site >= site and rs_site <= site1
   no-lock with frame b width 132 no-attr-space:

      /* SET EXTERNAL LABELS */
      setFrameLabels(frame b:handle).
      display rs_rsc rs_desc rs_site rs_um WITH STREAM-IO /*GUI*/ .

      for each rsd_det where rsd_rsc = rs_rsc
      and rsd_site = rs_site
      and (rsd_start >= start or start = ?)
      and (rsd_end <= rsdend or rsdend = ?)
      no-lock by rsd_rsc by rsd_site by rsd_end with frame b:

     display rsd_ref rsd_cap rsd_start rsd_end WITH STREAM-IO /*GUI*/ .
     down 1.

      end.

      
/*GUI*/ {mfguirex.i } /*Replace mfrpexit*/

   end.

   /* REPORT TRAILER */
   
/*GUI*/ {mfguitrl.i} /*Replace mfrtrail*/

/*GUI*/ {mfgrptrm.i} /*Report-to-Window*/


end.

/*K1DB*/ {wbrp04.i &frame-spec = a}

/*GUI*/ end procedure. /*p-report*/
/*GUI*/ {mfguirpb.i &flds=" rsc rsc1 site site1 start rsdend "} /*Drive the Report*/
